package com.jd.oneday.month3;

import java.util.Scanner;

/*
 *
 * 1.动态菱形
 *
 *      *
 *     ***
 *    ******
 *   ********
 *    ******
 *     ***
 *      *
 *
 */
public class Day04_yupeng {


    public static void main(String[] args) {


//        Scanner scanner = new Scanner(System.in);
//        int i = scanner.nextInt();
        // i 要求是奇数且>1
        methond(5);

    }


    public static void methond(int n) {
        int k = n/2;

        for (int i=0;i<n;i++) {
            if (i< n/2) {
                for (int j=0;j<n;j++) {
                    if (j<k-i || j>k+i){
                        System.out.print(" ");
                    } else {
                        System.out.print("*");
                    }
                }
            }
            if (i == k) {
                for (int j=0;j<n;j++) {
                    System.out.print("*");
                }
            }
            if (i > k) {
                for (int j=0;j<n;j++) {
                    if (j<i-k || j>i-k){        //  0<4-2  ||  0>4-2
                        System.out.print("-");
                    } else {
                        System.out.print("*");
                    }
                }
            }
            System.out.println("");
        }

    }
}
